package fit.nganhang;

import java.text.*;

public class account {
private long accNum;
private String accName;
private double accMon;
private double laixuat = 0.02;

public account() {
	this.accNum = 0;
	this.accName = null;
	this.accMon = 0;
}

public account(long accNum, String accName) {
	this.accNum = accNum;
	this.accName = accName;
	this.accMon = 100;
}

public account(long accNum, String accName, double accMon){
	this.accNum = accNum;
	this.accName = accName;
	this.accMon = accMon;
}

public long getaccNum() {
	return accNum;
}
public void setaccNum(long accNum) {
	this.accNum = accNum;
}
public String getaccName() {
	return accName;
}
public void setaccName(String accName) {
	this.accName = accName;
}

@Override
public String toString() {
	return "account [accNum=" + accNum + ", accName=" + accName + ", accMon="
			+ accMon + "]";
}


public double getaccMon() {
	return accMon;
}

public void setaccMon(double accMon) {
	this.accMon = accMon;
}

public void naptien(double tnap){
	accMon+=tnap;
}

public void ruttien(double trut, double phi){
	accMon-=(trut+phi);
}

public void daohan(){
	accMon+=accMon*laixuat;
}

public static void chuyenkhoan(account x, account y, double ck){
	x.accMon-=ck;
	y.accMon+=ck;
}

public static void main(String arg[]){
	account a = new account(131,"New",2000);
	System.out.println(a.toString());
	a.naptien(300);
	System.out.println(a.toString());
	a.ruttien(200, 50);
	System.out.println(a.toString());
	a.ruttien(200, 50);
	System.out.println(a.toString());
	account b = new account(123,"AccB");
	System.out.println(b.toString());
	chuyenkhoan(a,b,500);
	System.out.println("Tk gui="+a.toString()+", Tk nhan="+b.toString());
}
}
